﻿<%@ Page Title="" Language="C#" MasterPageFile="my-account.master" AutoEventWireup="true"
    CodeBehind="default.aspx.cs" Inherits="SocialShare.Web.My_Account._default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script src="<%= Utilities.SiteSettings.BaseUrl %>Scripts/jquery.ui.datepicker.js"
        type="text/javascript"></script>
    <script src="<%= Utilities.SiteSettings.BaseUrl %>Scripts/Jquery-UI/jquery.ui.core.js"
        type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $(".datepicker").datepicker({
                changeMonth: true,
                changeYear: true,
                showOn: "both",
                buttonImage: "../App_Style/images/Calendar_32.png",
                buttonImageOnly: true,
                showAnim: 'slideDown'
            });
        });
    </script>
    <section id="divMessage" runat="server" visible="false">
        <asp:Literal ID="lblMessage" runat="server"></asp:Literal>
    </section>
    <asp:FormView ID="frvUserProfile" runat="server" DataSourceID="odsUserProfile" CssClass="grid_12 alpha"
        DefaultMode="Edit" DataKeyNames="ProfileId">
        <EmptyDataTemplate>
            <section class="grid_6 desc-featured-content forum-post-list-item">
    No profile exist in system.
    </section>
        </EmptyDataTemplate>
        <EditItemTemplate>
            <section class="grid_8">
            <fieldset>
            <legend class="title-regular">Edit my profile</legend>
            <section class="grid_8 text-align-right omega">
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update"  CssClass="button small green" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" CssClass="button small red" />
                <section style="display:none;">
                <asp:Literal runat="server" ID="lituserID" Text='<%# Bind("UserId") %>'></asp:Literal>
                </section>
               </section>
           <section class="grid_2 alpha">
            <label>Blog Name:</label>
           </section>
           <section class="grid_6 omega">
            <input type="text" id="BlogNameTextBox" name="BlogNameTextBox" runat="server" required placeholder="Name" class="text" value='<%# Bind("BlogName") %>'  />
            <asp:RequiredFieldValidator ID="rfvBlogNameTextBox" runat="server" ErrorMessage="Required"  SetFocusOnError="true"
                        ControlToValidate="BlogNameTextBox" Display="Dynamic"></asp:RequiredFieldValidator>
                </section>
            <section class="grid_2 alpha">
            <label>First Name:</label>
            </section>
            <section class="grid_6 omega">
            <input type="text" id="First_NameTextBox" name="First_NameTextBox" runat="server" required placeholder="Name" class="text" value='<%# Bind("First_Name") %>'  />
             <asp:RequiredFieldValidator ID="rfvFirst_NameTextBox" runat="server" ErrorMessage="Required"  SetFocusOnError="true"
                        ControlToValidate="First_NameTextBox" Display="Dynamic"></asp:RequiredFieldValidator>
                </section>
            <section class="grid_2 alpha">
            <label>Last Name:</label>
            </section>
            <section class="grid_6 omega">
            <input type="text" id="Last_NameTextBox" name="Last_NameTextBox" runat="server" required placeholder="Name" class="text" value='<%# Bind("Last_Name") %>'  />
                   <asp:RequiredFieldValidator ID="rfvLast_NameTextBox" runat="server" ErrorMessage="Required"  SetFocusOnError="true"
                        ControlToValidate="Last_NameTextBox" Display="Dynamic"></asp:RequiredFieldValidator>
            </section>
            <section class="grid_2 alpha">
            <label >Date Of Birth:</label>
            </section>
            <section class="grid_6 omega">
            <input type="text" id="DOBTextBox" name="DOBTextBox" runat="server" required placeholder="Date Of Birth" class="datepicker text" value='<%# Bind("DOB", "{0:MM/dd/yyyy}") %>'  />
               <asp:RequiredFieldValidator ID="rfvDOBTextBox" runat="server" ErrorMessage="Required"  SetFocusOnError="true"
                        ControlToValidate="DOBTextBox" Display="Dynamic"></asp:RequiredFieldValidator>
            </section>
            <section class="grid_2 alpha">
            <label >Website:</label>
            </section>
            <section class="grid_6 omega">
            <input type="text" id="WebsiteTextBox" name="WebsiteTextBox" runat="server" placeholder="Website" class="text" value='<%# Bind("Website") %>'  />
            
            </section>
            <section class="grid_2 alpha">
            <label >Sex:</label>
            </section>
            <section class="grid_6 omega">
             <asp:DropDownList ID="ddlSex" runat="server"  SelectedValue='<%# Bind("Sex") %>'>
             <asp:ListItem Value="">None</asp:ListItem>
    <asp:ListItem Text="Male" Value="Male"></asp:ListItem>
    <asp:ListItem Text="Female" Value="Female"></asp:ListItem>
    </asp:DropDownList>
               <asp:RequiredFieldValidator ID="rfvddlSex" runat="server" ErrorMessage="Required"
                        ControlToValidate="ddlSex" InitialValue="" Display="Dynamic"></asp:RequiredFieldValidator><br />
            
            </section>
            </fieldset>
              </section>
        </EditItemTemplate>
        <ItemTemplate>
            <section class="grid_6 desc-featured-content forum-post-list-item">
           <section class="grid_2 alpha">
            <label>Blog Name:</label>
            </section>
             <section class="grid_4 omega">
            <asp:Label ID="BlogNameLabel" runat="server" Text='<%# Bind("BlogName") %>' />
            </section>
            <section class="grid_2 alpha">
            <label>First Name:</label>
            </section>
             <section class="grid_4 omega">
            <asp:Label ID="First_NameLabel" runat="server" 
                Text='<%# Bind("First_Name") %>' />
                </section>
            <section class="grid_2 alpha">
            <label>Last Name:</label>
            </section>
             <section class="grid_4 omega">
            <asp:Label ID="Last_NameLabel" runat="server" Text='<%# Bind("Last_Name") %>' />
            </section>
            <section class="grid_2 alpha">
            <label>DOB:</label>
            </section>
             <section class="grid_4 omega">
            <asp:Label ID="DOBLabel" runat="server" Text='<%# Bind("DOB") %>' />
            </section>
  <section class="grid_2 alpha">          
  
            <label>Website:</label>
            </section>
             <section class="grid_4 omega">
            <asp:Label ID="WebsiteLabel" runat="server" Text='<%# Bind("Website") %>' />
            </section>
            <section class="grid_2 alpha">
            <label>Sex:</label>
            </section>
             <section class="grid_4 omega">
            <asp:Label ID="SexLabel" runat="server" Text='<%# Bind("Sex") %>' />
           </section>
             <section class="grid_6 omega">
            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                CommandName="Edit" Text="Edit" CssClass="button small gray"/>
            </section>
                </section>
        </ItemTemplate>
    </asp:FormView>
    <asp:ObjectDataSource ID="odsUserProfile" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="GetUserProfileByID" TypeName="SocialShare.DAL.Facades.MemberFacade"
        DataObjectTypeName="SocialShare.BusinessEntities.SocialShare_MemberProfiles"
        UpdateMethod="UpdateMemberProfile" OnUpdated="odsUserProfile_Updated" OnUpdating="odsUserProfile_Updating">
        <SelectParameters>
            <asp:SessionParameter Name="userId" SessionField="LOGGED_IN_USER_ID" Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:ControlParameter Name="ProfileId" ControlID="frvUserProfile" />
            <asp:Parameter Name="UserId" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="BlogName" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="First_Name" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="Last_Name" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="DOB" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="Website" ConvertEmptyStringToNull="true" />
            <asp:Parameter Name="Sex" ConvertEmptyStringToNull="true" />
        </UpdateParameters>
    </asp:ObjectDataSource>
</asp:Content>
